#ifndef __DMA_HAL_H_
#define __DMA_HAL_H_

#define I2C_MEMADD_SIZE_8BIT 0x00000001U
#define InitDat 0x00
//---宏定义是否需要位置矫正---//
#define MyOLED 1

#if (MyOLED==1)             //1024-32=992;
#define OLED_Offset 992     
#endif

/// @brief  1.写入InitCMD至OLED(阻塞方式);  2.Buffer写为0x01;
/// @param  void
void OLED_DMA_Init(void);

/// @brief 开启Buffer至OLED的DMA传输
/// @param void
void OLED_Buffer_DMA_ON(void);

/// @brief 直接显示在屏幕上
/// @param Addr 0~1024
/// @param dat 1 Byte
void OLED_Buffer_Write(unsigned int Addr,unsigned char dat);

/// @brief ser方式插入字符至Buffer
/// @param ser 0~63
/// @param pchr 'A'
/// @return [0,1][ser越界,正常]
unsigned char OLED_Buffer_Inchar_ser(unsigned char ser,unsigned char* pchr);

/// @brief xy方式插入字符至Buffer
/// @param x 0~15
/// @param y 0~3
/// @param pchr 'A'
/// @return [0,1][x|y越界,正常]
unsigned char OLED_Buffer_Inchar_xy(unsigned char x,unsigned char y,unsigned char* pchr);

/// @brief 以ser方式插入string至Buffer
/// @param ser 0~63
/// @param pstr Array['A','B',...]
/// @param size 字符数量
/// @return [0,1][剩余空闲不足，正常]
unsigned char OLED_Buffer_Instr(unsigned char ser,unsigned char* pstr,unsigned char size);

/// @brief float to string
/// @param f 待转换的数
/// @return pstr 转换出的指针
unsigned char* Str8_float(float f);
#endif
